package com.mfkj.update.app

import com.blankj.utilcode.util.PathUtils
import com.mfkj.update.BuildConfig
import com.mfkj.update.CommKeys
import com.mfkj.update.mmkv
import com.mfkj.update.string
import java.io.File


object Constant {

    const val URL = "URL"
    const val INDEX = "INDEX"

    /**
     * 状态
     */
    const val BEFORE = 1//加载之前
    const val COMPLETE = 2//加载(成功/失败)完成
    const val ERROR = 3//加载出错
    const val HAS_MORE = 4//是否有更多数据
    const val STATE_LAYOUT = 5//设置空数据页面
    const val REQUEST_SUCCESS = 200//请求成功
    const val VIEW_EMPTY = 0//空页面

    const val CACHE = "CACHE"

    private const val SITE_ID = "ID"

    val screenFilePath = "${PathUtils.getExternalAppDataPath()}${File.separator}screen.png"

    var siteId by mmkv.string(key = SITE_ID, defaultValue = if (BuildConfig.DEBUG) "1" else "1")
    var url by mmkv.string(key = CommKeys.URL, defaultValue = "")

    const val DEFAULT_IMAGE_TIME: Long = 10 * 1000
    const val DEFAULT_VIDEO_TIME: Long = 15 * 1000

    var singleMode = false
}